import request from '@/utils/request'
// 获取工单状态列表
export const getAllTaskStatus = () => {
  return request.get('/api/task-service/task/allTaskStatus')
}
// 获取所有工单类型
export const getAllTaskType = () => {
  return request.get('/api/task-service/taskType/list')
}
// 获取工单列表
export const getTaskList = params => {
  return request.get('/api/task-service/task/search', {
    params
  })
}
// 获取工单详情
export const getTaskDetail = id => {
  return request.get('/api/task-service/task/taskInfo/' + id)
}
// 获取补货详情
export const getGoodsDetail = (id) => {
  return request.get('/api/task-service/taskDetails/' + id)
}
// 添加工单
export const addTask = data => {
  return request.post('/api/task-service/task/create', data)
}
// 取消工单
export const cancelTask = id => {
  return request.post('/api/task-service/task/cancel/' + id)
}
// 获取补货清单
export const getGoodsList = id => {
  return request.get('/api/vm-service/channel/channelList/' + id)
}
// 获取预警值
export const getAlert = params => {
  return request.get('/api/task-service/task/supplyAlertValue', {
    params
  })
}
// 设置预警阈值
export const setAlert = data => {
  return request.post('/api/task-service/task/autoSupplyConfig', data)
}
